package na.learn.java.threads;

/**
 * This class is composed of following two time values: 1. Time of birth 2. Time
 * to Live
 * 
 * An instance of this class, will be referenced by CompositeKey, and
 * corresponding CompositeValue objetcs.
 * 
 * @author nagrawal2
 * 
 */
public class CompositeTime {

	// Time to live assigned to this Object.
	// 0(ZERO) means this can live for-ever if there are no space
	// constraints.
	private Long endTime;

	// Time of creation of this object, in terms of measured in
	// milliseconds, between the current time and midnight,
	// January 1, 1970 UTC.
	private Long birthTime;

	public CompositeTime(Long timeToLive, Long birthTime) {
		this.endTime = birthTime + timeToLive;
		this.birthTime = birthTime;
	}

	public Long getBirthTime() {
		return birthTime;
	}

	public void setBirthTime(Long birthTime) {
		this.birthTime = birthTime;
	}

	public Long getEndTime() {
		return endTime;
	}

	public void setTimeToLive(Long endTime) {
		this.endTime = endTime;
	}

}
